<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			let allmess = []
			function fun(){
				let name = document.getElementById("name").value
				let mess = document.getElementById("xLYB").value
				let tp = "["+name+"]说:"+mess
				allmess.unshift(tp)
				if(allmess.length>10){
					allmess.pop();
				}
				document.getElementById("dLYB").value = allmess.join("\n")
			}
		</script>
	</head>
	<body>
		<form>
			姓名: <input type="text" id="name"><br>
			留言: <textarea name="" cols="30" rows="3" id="xLYB" style="resize: none; vertical-align: top;" ></textarea><br>
			<button type="reset">重置</button> 
			<button type="button" onclick="fun()">留言</button>
		</form>
		<hr>
		<textarea rows="10" cols="50" id="dLYB">
			
		</textarea>
	</body>
</html>
